#include <bits/stdc++.h>
using namespace std;

void solve() {
    int n;
    scanf("%d", &n);
    map<int, int> mp;
    for (int i = 0; i < n; i++) {
        int a;
        scanf("%d",&a);
        mp[a]++;
    }
    if (n % 2 != 0) {
        cout << "N0" << endl;
        return;
    }
    if (mp.size() == 2) {
        auto it = mp.begin();
        int c1 = it->second;
        it++;
        int c2 = it->second;
        if (c1 == c2) {
            cout << "Yes" << endl;
        } else {
            cout << "N0" << endl;
        }
    } else {
        cout << "N0" << endl;
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int t;
    scanf("%d", &t);
    while (t--) {
        solve();
    }
    return 0;
}